<%@ page language="java"
         import="com.ruohi.manage.DBType,com.ruohi.manage.PoolManager,com.ruohi.util.common.CommonForm,com.ruohi.util.common.CommonString,com.ruohi.util.common.Env,com.ruohi.util.dbutil.DBHelper"
         pageEncoding="UTF-8" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>
<%
	Connection connection = null;
	DBHelper dbHelper = DBHelper.getInstance();
	Map model = new HashMap();
	String tableName = "gift_dingzhi_moban_banner";
	String channelUUID = CommonString.getFormatPara(request.getParameter("channel_uuid"));
	Map adminInfo = (Map)session.getAttribute("adminInfo");
	
	try{
		connection = PoolManager.getConnection(DBType.getDBTypeByEnum("106013"));
		String id = CommonString.getFormatPara(request.getParameter("id"));
		if(null!=id&&!"".equals(id)){
			model = dbHelper.getMap(" select * from "+tableName+" where uuid = ? ",new Object [] {id} , connection);
		}
		if("".equals(channelUUID)&&null!=model){
			channelUUID = (String)model.get("channel_uuid");
		}
		
		
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=Env.getInstance().getProperty("project_name") %></title>
<link rel="stylesheet" type="text/css" href="/plugin/other/highslide/highslide.css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<link href="/backend/style/style.css" rel="stylesheet" type="text/css" />
<script src="/plugin/jquery/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/plugin/area/city/citys.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/editor/ueditor/editor_config.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/editor/ueditor/editor_all_min.js"></script>
<link rel="stylesheet" type="text/css" href="/plugin/editor/ueditor/themes/default/ueditor.css"/>
<style type="text/css">
.shade { filter:alpha(opacity=30); -moz-opacity:0.3; -khtml-opacity: 0.3; opacity: 0.3; background-color:#fff; position: relative; width: 130px; height: 135px; z-index: 4; display: none; }
.blue { border: 1px solid blue; }
.ccc { border: 1px solid #ccc; }
.toobar { position: absolute; bottom: 0px; height: 20px; width: 130px; border-top: 1px solid #ccc; }
.single_img { border: 1px solid #ccc; width: 130px; height: 135px; float:left; margin: 10px 0 10px 10px; display:inline; position:relative; cursor: pointer; overflow: hidden; }
.single_img .show_img { position:absolute; bottom: 20px; }
.formRight { text-align:left;}
</style>
</head>

<body style="margin: 0;padding: 0; overflow-y:auto; *overflow-y:hidden;">
<form name="theform" id="theform" action="/backend/action/crud.jsp?enumNo=106013">
  <div class="formDiv" style="position:relative; text-align:left;">
    <div class="group"> <span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span> <span class="groupTitle">基础信息</span> </div>
    <div class="formLeft"><span style="color:#F00">* </span>商品名称</div>
    <div class="formRight" style="width:190px">
      <input type="text" dataType="Require" msg="请输入商品名称" class="jr_text" name="zd_name" id="zd_name" value="<%=CommonString.getFormatPara(model.get("name")) %>" maxlength="50"/>
    </div>
    <div style="clear:left;"></div>
 
    
	 <div class="formLeft">顶部图片</div>
    <div class="formRight" style="width: 400px;">
		<input type="text" dataType="Require" msg="请上传顶部图片" readonly="readonly" class="jr_text" name="zd_flash" id="zd_flash" value="<%=CommonString.getFormatPara(model.get("flash")) %>" />
	</div>
	<div class="formRight" style="width: 100px;">
		<a href="<%=CommonString.getFormatPara(model.get("flash")) %>" id="a_flash" onclick='return hs.expand(this)'><img src="/backend/images/yulan.gif" /></a>
		<span id="equi_flash"></span>
	</div>
    <div style="clear:left;"></div>
     
	
    <div class="group"> <span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span> <span class="groupTitle">扩展信息</span> </div>
    <div class="formLeft">是否显示</div>
    <div class="formRight" style="width:190px"> <%=CommonForm.createIsRadio(CommonString.getFormatPara(model.get("is_show")),"zd_is_show") %> </div>
   
    <div class="formLeft">点击次数</div>
    <div class="formRight" style="text-align: left;width:150px">
      <input type="text" class="jr_text" style="width: 150px;" name="zd_view_count" id="zd_view_count" value="<%=CommonString.getFormatPara(model.get("view_count")) %>" />
    </div>
    
  </div>
  <input type="hidden" name="tableName" id="tableName" value="<%=tableName %>" />
  <input type="hidden" name="zd_id" id="zd_id" value="<%=CommonString.getFormatPara(model.get("id")) %>" />
  <input type="hidden" name="zd_order_no" id="zd_order_no" value="<%=CommonString.getFormatPara(model.get("order_no")) %>" />
  <input type="hidden" name="zd_channel_uuid" id="zd_channel_uuid" value="<%=channelUUID %>" />
  <input type="hidden" name="eventAfter" id="eventAfter" value="" />
</form>
</body>
</html>
<script type="text/javascript" src="/plugin/jquery/jquery.form.js"></script>
<script src="/plugin/ui/ligerUI/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="/backend/scripts/common.js?tab" type="text/javascript"></script>
<script src="/plugin/validator/wofoshan/validator.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/plugin/other/highslide/highslide.min.js"></script>
<script type="text/javascript" src="http://img.52sdskj.com/plugin/upload/jr_upload.js"></script>
<script src="/plugin/date/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

<script src="/plugin/ui/jqueryUI/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript">
	hs.graphicsDir = '/plugin/other/highslide/graphics/';
	hs.wrapperClassName = 'wide-border';
	jQuery("#equi_img").JrUpload({
        remotUrl: "http://img.52sdskj.com/upload.jsp",
		folder : "qikan" ,
		watermark:false,
		callback : "setEquiImg"
	});
	function setEquiImg(data){
        var imgUrl = "http://img.52sdskj.com" + data;
		jQuery("#a_img").attr("href",imgUrl);
		jQuery("#zd_img").val(imgUrl);
	}
	//banana

	jQuery("#equi_flash").JrUpload({
        remotUrl: "http://img.52sdskj.com/upload.jsp",
		folder : "qikan" ,
		isResize : false,
		watermark:false,
		callback : "setEquiImg2"
	});
	function setEquiImg2(data){
        var imgUrl = "http://img.52sdskj.com" + data;
		jQuery("#a_flash").attr("href",imgUrl);
		jQuery("#zd_flash").val(imgUrl);
	}
	
		//background

	jQuery("#equi_color").JrUpload({
        remotUrl: "http://img.52sdskj.com/upload.jsp",
		folder : "qikan" ,
		watermark:false,
		callback : "setEquiImg3"
	});
	function setEquiImg3(data){
        var imgUrl = "http://img.52sdskj.com" + data;
		jQuery("#a_color").attr("href",imgUrl);
		jQuery("#zd_color").val(imgUrl);
	}
	
	function doSub(dialog){
		var rs = Validator.Validate(document.getElementById("theform"),1);
		if(rs){
			jQuery("#theform").ajaxSubmit({
				type : "POST",
				async : false ,
				success : function(data) {
					var rs = parseInt(jQuery.trim(data), 10);
					if (rs > 0) {
						window.parent.jQuery.ligerDialog.success("操作成功", "提示", function(){
							dialog.close();
						});
					} 
				}
			});	
		}
	}
	
</script>
<%
	}catch(Exception e){
		e.printStackTrace();
	}finally{
		DBHelper.freeConnection(connection);
	}
%>